<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>2-5 border</title>
  <style>
    .box {
      width: 300px;
      height: 160px;
      background: #17c27b;
      border-radius: 10px;
      position: relative;
      font-size: 22px;
      color: white;
    }

    .box.checked::after {
      content: "";
      width: 0;
      height: 0;
      position: absolute;
      right: 0;
      top: 0;
      border-top: 100px solid #e55039;
      border-left: 100px solid transparent;
    }
  </style>
</head>

<body>
  <div class="box">点击切换</div>
</body>

</html>